import './style.less';
import LogoImg from '@/assets/logo.png';
import { Divider, Button, Space } from 'antd-mobile';
import { useNavigate } from "react-router-dom";

// 声明式
const Admin = () => {
  const  navigate = useNavigate();
  const onConfirm = (path)=>{
    navigate(path);
  }
  return (
    <>
      <div className="home">
        <div>
          <div className='title'>
            <img src={LogoImg}/>
            排班管理系统
          </div>
          <Divider />
          <Space>
            <Button
              color="success"
              fill="solid"
              onClick={() => {
                onConfirm('/admin/user');
              }}>
              管理人员
            </Button>
            <Button
              color="success"
              fill="solid"
              onClick={() => {
                onConfirm('/admin/ban');
              }}>
              去排班
            </Button>
          </Space>
        </div>
      </div>
    </>
  );
};

export default Admin;
